<template>
	<view>
		<view class="topcontent">
			<view>
				<view class="money">下线:<text style="font-weight: 600;color: #FD4F00;padding-left: 10px"> {{total}}</text></view>
			</view>
			<view>
				<view class="money">会员:<text style="font-weight: 600;color: #FD4F00;padding-left: 10px"> {{vip}}</text></view>
			</view>
		
		</view>
		<view class="content">

		  <view class="wanl-order-list">
			   <view class="navbar" style="background-color: wheat;display: block;height: auto;">
					<view class="nav-item text-df" v-for="(item, index) in navList" :key="item.state" :class="{ current: tabCurrentIndex === index }" @tap="tabClick(index)">
						{{ item.text }}
					</view>
					<view class="nav-item text-df" style="float: left;">
						更多
					</view>
					<view style="clear: both;"></view>
				</view>
				<swiper :current="tabCurrentIndex" duration="300" style="height: 580px">
					<swiper-item class="tab-content" v-for="(item,key) in dataList" >
						<scroll-view class="list-scroll-content content1" scroll-y>						
								<view class="conten">
									<view class="item">
										<view class="tit">注册</view>
										<view class="ss">{{item.total}}</view>				
									</view>			
									<view class="item">
										<view class="tit">会员</view>
										<view class="ss">{{item.vip}}</view>				
									</view>
								</view>	
								<view class="userlist cu-list menu-avatar" v-if="item.u">
									<view class="cu-item" v-for="(tag, index) in item.u" >	
										<view class="key">
											{{index+1}}
										</view>						
										<view class="nickname">
											{{tag.nickname}}
										</view>
										<view class="mobile">
											
										</view>
										<view class="vip">
											{{tag.is_vip?'VIP':''}}
										</view>
									</view>
								</view>					
						</scroll-view>						
					</swiper-item>
				</swiper>
			</view>
		
		</view>
			
	</view>
</template>

<script>	
	import { mapState } from 'vuex';
	export default {
		data() {
			return {
				tabCurrentIndex: 0,
				navList: [],
				dataList:{},
				nicknames: {},
				total:0,
		        vip:0
			};
		},
		computed: {
			...mapState(['user'])		
		},
		onLoad() {
			this.loadDate();
		},
		methods: {
			async loadDate() {
				await uni.request({
					url: '/wanlshop/user/offlines',
					data: {},
					method:'POST',
					success: res => {
						this.navList = res.data.nav;
						this.dataList = res.data.users;
						this.nicknames = res.data.nicknames;
						this.total = res.data.total;
						this.vip = res.data.vip;
					}
				});
				
			},
			//顶部tab点击
			tabClick(index) {
				this.tabCurrentIndex = index;
			},
			
			
			
		}
	}
</script>

<style>
	.topcontent{
		height: 160rpx;
		width: 100%;
		background-color: #F0A20F;
		color:white;
		text-align:center;
	}
	.topcontent .money{
		font-size:34rpx;
		text-align: center;
		padding: 10rpx 0;
	}
	.topcontent .sm{
		margin-top: -20rpx;
		font-size:26rpx;		
	}
	.topcontent .xg{
		margin-top: 20rpx;
		color:#F0A20F;
		background-color: white;		
	}
	.content1{
		width: 100%;
		
		background-color: #ffffff;
	}
	.content1 .title{		
		padding: 20rpx;
		text-align: center;
		font-weight: 600;
	}
	.conten{
		padding-top: 10px;
		height: 120rpx;
	}
	.content1 .conten .item{
		width: 49%;
		float: left;
		text-align: center;
		padding: 0 20rpx;	
		height: 100%;
	}
	.content1 .conten .item .tit{
		height: 60rpx;
	}
	.content1 .conten .item .ss{
		color: #FD4F00;
	}

	.navbar .text-df{
		width: 140rpx;
		float: left;
		line-height: 60rpx;
	}
	.userlist{
		height: 500px;
		overflow: auto;
	}
	.userlist .cu-item{
		display: block !important;
		line-height: 50px;
		height: 50px;
	}
	.userlist .cu-item .key{
		text-align: center;
		width: 10%;float: left;
		color: gray;
	}
	.userlist .cu-item .nickname{
		text-align: center;
		width: 20%;float: left;
	}
	.userlist .cu-item .mobile{
		text-align: center;
		width: 40%;float: left;
	}
	.userlist .cu-item .vip{
		text-align: center;
		width: 20%;float: right;
		color: #F0A20F;
	}
</style>

